package cj.web.tel.service;
/*
 *  
 *  
*/
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cj.web.tel.domain.GroupOffices;
import cj.web.tel.dao.GroupOfficesDAO;

/**
 * 
 * @author 
 *
 */
@Service
public class GroupOfficesService{

	@Autowired
    private GroupOfficesDAO groupOfficesDAO;
	
	/**
	 * 查询
	 * @param groupOffices
	 * @return groupOfficeslis;size
	 */
	public Map query(GroupOffices groupOffices){
		Map rep = new HashMap();
		List<GroupOffices> groupOfficeslis = groupOfficesDAO.query(groupOffices);
		int size = groupOfficesDAO.querySize(groupOffices); 
		rep.put("groupOfficeslis", groupOfficeslis);
		rep.put("size", size);
		return rep;
    }
	
	public GroupOffices queryById(int id){
		GroupOffices obj = groupOfficesDAO.queryById(id);
		return obj;
    }
	
	public List<GroupOffices> queryAllById(int depId){
		List<GroupOffices> objlis = groupOfficesDAO.queryAllById(depId);
		return objlis;
    }
	
	public void create(GroupOffices groupOffices){
		groupOfficesDAO.create(groupOffices);
	}
	
	public void update(GroupOffices groupOffices){
		groupOfficesDAO.update(groupOffices);
	}
	
	public void deleteById(int id){
		groupOfficesDAO.deleteById(id);
	}
}